package com.sam.jenkins;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;

/**
 * @author sam-02
 */
@SpringBootApplication
@RestController
public class JenkinsApplication {

    public static void main(String[] args) {
        SpringApplication.run(JenkinsApplication.class, args);
    }

    @GetMapping("index")
    public Object index() {
        final HashMap<String, String> stringStringHashMap = new HashMap<>(2);
        stringStringHashMap.put("name", "Jenkins");
        stringStringHashMap.put("version", "2.249.3");
        stringStringHashMap.put("author", "Sam");
        stringStringHashMap.put("id", "10086");
        stringStringHashMap.put("datetime", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        return stringStringHashMap;
    }

    @GetMapping("login")
    public String login() {
        return "登录成功";
    }

    @GetMapping("logout")
    public String logout() {
        return "退出成功";
    }

    @GetMapping("info")
    public String info() {
        return "git info";
    }
    @GetMapping("delete")
    public String delete(){
        return "删除用户";
    }

    @GetMapping("password")
    public String password() {
        return "修改密码";
    }
}
